﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConsoleTest.TestList
{
    public class Test01_IO
    {
        /// <summary>
        /// 未处理异常的情况
        /// </summary>
        /// <param name="filePath"></param>
        public static void Test(string filePath)
        {
            FileInfo file = new FileInfo(filePath); // NotSupportedException

            FileStream fs = file.Open(FileMode.Append, FileAccess.Write);
            StreamWriter writer = new StreamWriter(fs);

            writer.WriteLine("{0}: {1}",
                DateTime.Now.ToLongTimeString(),
                "这是一个测试条目");

            writer.Flush();
        }
    }
}
